package com.neusoft.lohas.modules.api;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import com.neusoft.lohas.common.restTemplate.client.ResourceEnum;
import com.neusoft.lohas.common.restTemplate.client.ResourceHandleResult;
import com.neusoft.lohas.common.restTemplate.client.ResourceHandleType;
import com.neusoft.lohas.common.restTemplate.client.ServerApi;

@Service
@Transactional(readOnly = true)
public class SmsControllerAPI {

	/**
	 * 发送验证码
	 * @param actSubject
	 * @return
	 */
	public String sendCheckCode(String mobile) {
		MultiValueMap<String, Object> param = new LinkedMultiValueMap<String, Object>();
		param.add("mobile", mobile);
		ResourceHandleResult<String> result = ServerApi.getInstance()
				.remoteResourceHandle(param, ResourceHandleType.POST,
						ResourceEnum.SEND_CHECKCODE, String.class, null);
		return result.getResourceEntity();
	}
}
